<template>
  <div class="app">
    我是APP组件-钱包: {{ money }} - 银行信息: {{ info }}
    <button @click="changeMoney">修改数据</button>
    <button @click="changeBankMoney">修改银行卡数据</button>
    <SonA></SonA>
    <SonB></SonB>
  </div>
</template>

<script>
// 爷爷
import SonA from './components/SonA.vue'
import SonB from './components/SonB.vue'
export default {
  provide(){
    return {
      money: this.money,
      info: this.info
    }
  },
  data() {
    return {
      money: 999999,
      info: {
        name: '张三',
        bankMoney: 189000000000,
      },
    }
  },
  methods: {
   
    changeMoney(){
      this.money += 10000
    },
    changeBankMoney(){
      this.info.bankMoney -= 100000
    }
  },
  components: {
    SonA,
    SonB,
  },
}
</script>

<style>
.app {
  border: 3px solid #000;
  border-radius: 6px;
  margin: 10px;
}
</style>